package com.kuyun.parseexcel.parsemodule.controller;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.analysis.ExcelReadExecutor;
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.kuyun.parseexcel.parsemodule.bean.JHACSExcel;
import com.kuyun.parseexcel.parsemodule.bean.TemplateBean;
import com.kuyun.parseexcel.parsemodule.strategyInterface.strategyImpl.JhacsExcelDataHandle;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.util.List;

@RestController
public class ParseExcelController {

    @RequestMapping("parseJHACS")
    public Object parseJHACS(HttpServletRequest request) {


        return "成功";
    }

    @RequestMapping("test")
    public Object test(HttpServletRequest request) {
        String path = request.getParameter("path");
        if (StringUtils.isEmpty(path)) {
            return "失败，path 属性传值错误";
        }
        JhacsExcelDataHandle jhacsExcelDataHandle = new JhacsExcelDataHandle(path);
        jhacsExcelDataHandle.doExcelReaderBuilder();
        return "成功";
    }


}
